package com.utility;

import org.apache.commons.configuration.*;

public class PropertiesConjunction {
	
	
	public static Configuration getCoreConfiguration() {
		
		Configuration configuration = null;
		
		try {
			AbstractConfiguration.setDefaultListDelimiter('\t');
			configuration = new PropertiesConfiguration("configuration/config.properties");

		} catch (ConfigurationException e) {
			e.printStackTrace();
		}
		
		configurationLoadVerification(configuration);
		
		return configuration;
	}
	
	
	
	private static void configurationLoadVerification(Configuration configuration) {
		String msg = configuration.getString("defaultMsg");
		
		if (msg == null) {
			System.out.println("cannot load \"msg\".");
			System.exit(100);
		}
		else {
			System.out.println(msg);
		}
	}

}
